#ifndef SEMIHOSTING_H
#define SEMIHOSTING_H

#include "stdint.h"

typedef enum HOST_SYSCALL {
	HOSTCALL_WRITE = 0x05,
	HOSTCALL_READ = 0x06,
} HostSystemCall;

typedef union param_t {
	int paramInt;
	void *paramPointer;
} ParameterUnion;

extern void host_call(HostSystemCall type, void *args) __attribute__((naked));

extern int host_read(int fd, void *buf, uint32_t count);

extern int host_write(int fd, const void *buf, uint32_t count);

#endif
